<%-- 
    Document   : index
    Created on : 07.09.2010, 12:34:26
    Author     : nico.rehwaldt
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="u" uri="http://nixis.de/jsp/tags/core" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<html>
    <head>
        <title>Welcome</title>
        <style type="text/css">
            @import url('<u:url value="/style/portal.css" />');
        </style>
    </head>
    <body>
        <div class="heading main-heading">
            <h1>Welcome friend!</h1>
        </div>
        <p>
            Welcome to First Friend, your one stop to get your studies started.
            Our application will help you with getting an overview about
            important tasks and allows you to organize your work in todo lists.
            Feel free to check out the <a href="#topics">hot topics below</a> or use the
            search in the upper left.
        </p>

        <c:if test="${currentUser == null}">
        <p>
            Most of the functionality in this system is only available if you
            <a title="Login" class="ajax" rel="login-dialog" href="<u:url value="/user/login" />">login</a>. 
        </p>
        </c:if>
        
        <h2 id="topics">Topics of interest</h2>
        <div>
            <c:forEach var="info" items="${it.topicInfos}">
                <div class="topic-overview">
                    <h3>
                        <a title="View all ${info.articleCount} articles filed under ${info.topic.name}" href="<u:url value="/topic/${info.topic.id}-${info.topic.slug}"/>">
                            ${info.topic.name} (${info.articleCount})
                        </a>
                    </h3>
                    <ul>
                        <c:forEach var="article" items="${info.articles}">
                            <li><a title="View article ${article.title}" href="<u:url value="/article/${article.sluggedId}" />">${article.title}</a></li>
                        </c:forEach>
                        <c:if test="${fn:length(info.articles) < info.articleCount}">
                            <li>
                                <a href="<u:url value="/topic/${info.topic.id}-${info.topic.slug}"/>" class="show-all-link">show all</a>
                            </li>
                        </c:if>
                    </ul>
                </div>
            </c:forEach>
        </div>
    </body>
</html>